Skip to content

Toccata transient mass activation and mempool policy refinement#995

Merged
michaelsutton merged 18 commits into
kaspanet:toccatafrom
michaelsutton:transient-activation
May 14, 2026
Merged

Toccata transient mass activation and mempool policy refinement#995
michaelsutton merged 18 commits into
kaspanet:toccatafrom
michaelsutton:transient-activation

Conversation

@michaelsutton
Copy link
Copy Markdown
Contributor

Implements the Toccata transient mass activation, including forked block mass limits and delayed mempool adoption of the relaxed transient limit so pre-activation and near-boundary transactions remain safely conservative.

Also polishes mempool policy around the activation:

  • moves template-fit checks out of standardness and into explicit template-limit validation
  • applies relay fee checks over both non-contextual mass dimensions
  • activation logic for signature script length limit change
  • removes obsolete dust standardness checks covered systemically by KIP-9 storage mass (ever since crescendo)
  • adds focused tests for transient mass activation, template selection, and policy behavior across the activation boundary

Add validate_transaction_template_limits as a post-consensus mempool admission
check. It rejects txs that cannot fit in a block template under the current
delayed mempool limits, before standardness-in-context and RBF eviction.

Use raw per-dimension limits for clearer errors: compute, transient, storage,
and gas. Keep mempool_block_mass_limits in Config alongside derived cofactors,
so selectors/RBF still use normalized weights while admission checks raw fit.

Clean standardness tests by removing stale mass/gas cases and decoupling relay
fee arithmetic from the removed standard mass constant. Extend Toccata tests to
cover delayed transient admission and gas rejection even when non-standard txs
are allowed.
base the standard relay fee floor on max(compute, transient) so transient block-space usage has a minimum cost, move fee check out of the loop so it's checked once and not per input and add context-standardness coverage for fee and input script checks.
Set the classic P2SH sigop standardness cap to match the previous 100k compute-mass allowance, and document why compute mass remains the real execution bound.
Remove the redundant is_unspendable branch from dust classification: standardness already rejects non-standard SPKs before dust, and standard SPK classes are spendable.
Drop the relay-fee dust threshold from mempool standardness and remove the mining dust helper. KIP9 storage mass already prices UTXO growth at the system level.
Comment thread consensus/core/src/config/params.rs Outdated
Split template-limit validation into isolation and context phases so gas,
compute and transient limits are rejected before consensus in-context validation.
Keep storage checks after contextual mass is populated and cover the ordering in
Toccata transient mass activation tests.
Use the real contextual storage mass calculation in Toccata mempool tests and
add a tiny-output case that rejects with RejectStorageMass after consensus
in-context validation.
Separate duplicate detection from isolation standardness and rename the local
standardness helpers to std_in_isolation/std_in_context. Reuse the same
transaction-id checks before and after consensus validation to make the
concurrency recheck semantics explicit.
Base the minimum relay fee on max(compute, normalized transient) using stable post-activation cofactors, so activation only changes limits, not unit pricing. Split insufficient-fee errors by dominant mass dimension.

Change devnet/simnet pre-activation transient limits so that devnet/simnet tests and runs trigger the activation case.
Assert that mempool mass cofactors keep the same reference across activation, and document the selector assumption when using the post-activation reference.
@michaelsutton michaelsutton force-pushed the transient-activation branch from 1219408 to 404eb44 Compare May 13, 2026 10:53
coderofstuff
coderofstuff previously approved these changes May 13, 2026
Comment thread consensus/core/src/config/params.rs Outdated
Comment thread mining/src/mempool/replace_by_fee.rs Outdated
Comment thread mining/src/mempool/replace_by_fee.rs Outdated
Comment thread mining/src/mempool/replace_by_fee.rs Outdated
Comment thread testing/integration/src/consensus_integration_tests.rs Outdated
Comment thread mining/src/mempool/check_transaction_standard.rs
Comment thread mining/src/mempool/check_transaction_standard.rs Outdated
Use current mempool mass cofactors for both the replacement and replaced transactions, and split out policy-only RBF checks for orphan paths that do not need a feerate threshold.
Mechanically move transaction block-limit validation out of validate_and_insert_transaction into check_transaction_limits, and add focused tests for gas, compute, transient, and storage limit errors.
Keep the Toccata activation tests intact and document which pipeline checks should survive the post-fork cleanup.
@michaelsutton michaelsutton merged commit 53cb0f3 into kaspanet:toccata May 14, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants